<tagLib name="html" />
<script language="javascript" src="/Public/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<div id="main-content">
    <div id="main" class="main">
        <!-- 修改密码 start -->
        <div class="spin-cont">
            <div class="user-hd">
                <h2>影院管理>>{$page_title}</h2>
                <a class="kehu" href="javascript:history.back();">
                  返回
                </a>
            </div>
            <div class="user_zl">
                <form name="data_form" id="data_form" method="POST">
                <dl class="clearfix">
                    <dt>主机名：</dt>
                    <dd>
                        <if condition="1 EQ $is_add">
                            <input type="text" id="host_name" name="host_name" autocomplete="off" maxlength="18" placeholder="请输入主机名(英文、数字或中划线，最长18位)" class="bg-input w229"/>
                        <else/>
                            {$model.host_name}
                        </if>
                    </dd>
                    <dd class="error_message" id="message_host_name"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>影院名：</dt>
                    <dd>{$model.cinema_name}</dd>
                    <dd class="error_message" id="message_address"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>影院地址：</dt>
                    <dd>
                        {$model.area_1|getAreaName}{$model.area_2|getAreaName}{$model.area_3|getAreaName}{$model.address}
                    </dd>
                    <dd class="error_message" id="message_area"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>联系人：</dt>
                    <dd>{$model.contacter}</dd>
                    <dd class="error_message" id="message_contacter"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>手机号码：</dt>
                    <dd>{$model.phone}</dd>
                    <dd class="error_message" id="message_phone"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费方式：</dt>
                    <dd>
                        {$recharge_method_options[$model[recharge_method_id]]}
                    </dd>
                </dl>
                <dl class="clearfix">
                    <dt>2016计费方式：</dt>
                    <dd>
                        {$billing_video_play_type[$model[billing_video_play_type]]}
                        
                    </dd>
                </dl>
                <dl class="clearfix">
                    <dt>所属代理：</dt>
                    <dd>
                        {$agent_options[$model[agent_id]]|default="平台直属影院"}
                    </dd>
                    <dd class="error_message" id="message_agent_id"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费金额：</dt>
                    <dd>
                        <if condition="1 NEQ $is_add">
                            {$model.hall_price}
                            <input type="hidden" id="hall_price" name="hall_price" value="{$model.hall_price}" maxlength="2" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" autocomplete="off" class="bg-input w229"/> 元 / 间 - 月
                        <else/>
                            <input type="text" id="hall_price" name="hall_price" value="{$model.hall_price}" maxlength="2" placeholder="请填写计费金额" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" autocomplete="off" class="bg-input w229"/> 元 / 间 - 月
                        </if>
                    </dd>
                    <dd class="error_message" id="message_hall_price"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>授权房间：</dt>
                    <dd>
                        <if condition="1 NEQ $is_add">
                            {$model.buy_hall_count}
                            <input type="hidden" id="buy_hall_count" name="buy_hall_count" value="{$model.buy_hall_count}" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 间
                        <else/>
                            <input type="text" id="buy_hall_count" name="buy_hall_count" value="{$model.buy_hall_count}" placeholder="请输入授权房间数量，最大为数字99" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 间
                        </if>
                    </dd>
                    <dd class="error_message" id="message_buy_hall_count"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费周期：</dt>
                    <dd>
                        <if condition="1 NEQ $is_add">
                            {$model.period_count}
                            <input type="hidden" id="period_count" name="period_count" value="{$model.period_count}" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 月
                        <else/>
                            <input type="text" id="period_count" name="period_count" value="{$model.period_count}" placeholder="请输入合同周期的月数，最大为数字99" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 月
                        </if>
                    </dd>
                    <dd class="error_message" id="message_period_count"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>扣费周期：</dt>
                    <dd>
                        <if condition="1 NEQ $is_add">
                            {$deduct_period_options[$model[deduct_period]]}
                            <div style="display: none;">
                            <html:select options="deduct_period_options" name="deduct_period" id="deduct_period" change="calculatePeriodMoney()" selected="model[deduct_period]" />
                            </div>
                        <else/>
                            <html:select options="deduct_period_options" name="deduct_period" id="deduct_period" change="calculatePeriodMoney()" selected="model[deduct_period]" />
                        </if>
                    </dd>
                    <dd class="error_message" id="message_deduct_period"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>本期扣费截止日期：</dt>
                    <dd><?php  if(empty($model['last_cost_time'])) $model['last_cost_time'] = $model['join_time']; echo date("Y-m-d",$model['last_cost_time']+($model['deduct_period']*31*86400));  ?></dd>
                </dl>					
                <dl class="clearfix">
                    <dt>每期扣费总计：</dt>
                    <dd id="period_money"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费总计：</dt>
                    <dd id="total_money"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>备注：</dt>
                    <dd>{$model.remark}</dd>
                </dl>
                <if condition="1 NEQ $is_add">
                <dl class="clearfix">
                    <dt>加盟时间：</dt>
                    <dd>{$model.join_time|date="Y-m-d H:i", ###}</dd>
                </dl>
                <dl class="clearfix">
                    <dt>当前余额：</dt>
                    <dd>{$model.money} 元</dd>
                </dl>
                <dl class="clearfix">
                    <dt>影厅数量：</dt>
                    <dd>{$model.video_hall_count} 间</dd>
                </dl>
                </if>
                <dl class="clearfix">
                    <dt></dt>
                    <dd>
                        <a href="javascript:;" class="gray-btn" onclick="reset('data_form')">返回</a>
                    </dd>
                </dl>
                </form>
            </div>
        </div>
    </div>
</div>
<script language="javascript">
    //是否新增
    is_add = {$is_add};
    
    $(document).ready(function(){
        //计算金额总计
        calculatePeriodMoney();
        
        //禁用控件
        $('#mutil_level_data_1_id_1').attr('disabled', true);
        $('#mutil_level_data_1_id_2').attr('disabled', true);
        $('#mutil_level_data_1_id_3').attr('disabled', true);
    });
</script>